<?php
    /**
     * Created by PhpStorm.
     * User: zgh
     * Date: 2021-08-06
     * Time: 14:17
     */

    namespace app\api\controller;


    use app\admin\service\UploadService;
    use app\common\controller\ApiController;
    use hg\apidoc\annotation as Apidoc;
    use app\common\Annotation\ApiControllerAnnotation;
    use think\facade\Request;


    /**
     * @ApiControllerAnnotation(auth=0)
     * @Apidoc\Title("公共模块")
     * @Apidoc\Group("base")
     * @package app\api\controller
     */
    class CommonController extends ApiController
    {

        /**
         * @Apidoc\Title("文件上传")
         * @Apidoc\Url("common/upload")
         * @Apidoc\Param(ref="app\api\apidoc\CommonDoc\upload")
         * @Apidoc\Returned(ref="app\api\apidoc\CommonDoc\upload")
         */
        public function upload()
        {
            $params = Request::param();
            $form_name = "file";
            $result_data = UploadService::upload($form_name, $params);
            return success_json_response($result_data);
        }
    }